package com.example.service.webhook.business.security.repository;

import com.example.service.webhook.business.security.entity.MedicalInsuranceRecordEntity;
import com.example.service.webhook.repository.base.BaseDAO;
import com.example.service.webhook.util.DateUtil;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

@Repository
public class MedicalInsuranceRecordRepository extends BaseDAO<MedicalInsuranceRecordEntity>{
	
	@Resource(name="templateSecurity")
    private JdbcTemplate jdbcTemplate;

    public JdbcTemplate getJdbcTemplate() {
		return jdbcTemplate;
	}
    
    public void saveMedicalInsuranceRecordEntity(MedicalInsuranceRecordEntity entity) throws Exception  {
    	entity.setCreateTime(DateUtil.getCurrentDate());
    	entity.setLastModifyTime(DateUtil.getCurrentDate());
		this.add(entity);
    }
    
    public void deleteMedicalInsuranceRecordEntity(String userId,String userInfoId){
    	String sql = "delete from t_medical_insurance_record where userId=? and userInfoId=?";
    	this.delete(sql, new Object[]{userId,userInfoId});
    }
    
  
    
}
